home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / COMPTOOL / MCI / MCITEST.BAS < prev    next >
Encoding:
BASIC Source File  |  1996-11-29  |  1.1 KB  |  37 lines

  1. Attribute VB_Name = "Module2"
  2. ' Force all run-time errors to be handled here.
  3. Sub DisplayErrorMessageBox()
  4.     Dim Msg As String
  5.     Select Case Err
  6.         Case conMCIErrCannotLoadDriver
  7.             Msg = "Error load media device driver."
  8.         Case conMCIErrDeviceOpen
  9.             Msg = "The device is not open or is not known."
  10.         Case conMCIErrInvalidDeviceID
  11.             Msg = "Invalid device id."
  12.         Case conMCIErrInvalidFile
  13.             Msg = "Invalid filename."
  14.         Case conMCIErrUnsupportedFunction
  15.             Msg = "Action not available for this device."
  16.         Case Else
  17.             Msg = "Unknown error (" + Str$(Err) + ")."
  18.     End Select
  19.  
  20.     MsgBox Msg, 48, conMCIAppTIitle
  21. End Sub
  22.  
  23. ' This procedure allows any Windows event to be processed.
  24. ' This may be necessary to solve any synchronization
  25. ' problems with Windows events.
  26. ' This procedure can also be used to force a delay in
  27. ' processing.
  28. Sub WaitForEventsToFinish(NbrTimes As Integer)
  29.     Dim i As Integer
  30.  
  31.     For i = 1 To NbrTimes
  32.         dummy% = DoEvents()
  33.     Next i
  34. End Sub
  35.  
  36.  
  37.